﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a03
    {
		private string _levername;
        private int? _levercode;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 1-销售商级，2-区域，3-门店，4特殊
        /// </summary>
		public string Levername
		{
			get { return _levername;	 }
			set { _levername=value;	}
		}
        /// <summary>
        /// 合同级别代码
        /// </summary>
		public int? Levercode
		{
			get { return _levercode;	 }
			set { _levercode=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas1a03> GetBas1a03ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a03> list = new List<Bas1a03>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a03 model = GetBas1a03ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a03 GetBas1a03ByDataRow(DataRow dr)
		{
			Bas1a03 model = new Bas1a03(); //实例化Bas1a03
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("levername")&&!(dr["levername"] is System.DBNull))  
				model.Levername = ( string)dr["levername"];
			if (dcc.Contains("levercode")&&!(dr["levercode"] is System.DBNull))  
				model.Levercode = ( int)dr["levercode"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
